<?php
/**
 * we7_baiduappdemo模块微站定义
 *
 * @author 微擎团队
 * @url
 */
defined('IN_IA') or exit('Access Denied');

class Yts_qiyeModuleSite extends WeModuleSite {
	public $setting_id;
	public function __construct(){
		
		if($_GET['setting_id']){
			$this->setting_id = $_GET['setting_id'];
		}else{
			$this->setting_id = 1;
		}
	}

		/**
	 * 图片补全URL路径
	 * params  string
	 * return string
	*/
	
	private function attach($img_path){
		global $_W;
		if(!$img_path){
			return  $img_path;
		}
		if(strpos($img_path,'http://') !== false OR strpos($img_path,'https://') !== false){
			return  $img_path;
		}else{
			return $_W['siteroot'] . 'attachment/'.$img_path;
		}
	}


	// 分类
	public function doWebCategory(){
		global $_W, $_GPC;
		$type_id = $_GPC['type'];

		if(!$type_id){
			$type_id = 1;
		}
		// $get_list = pdo_getall('yts_qiye_category');

		$_pageisze = 20;
		$_currentPage = max((int)$_GPC['page'],1);
		$_limit = ' LIMIT '.($_currentPage - 1)*$_pageisze.', '.$_pageisze;
		$_WHERE ='where type = ' .$type_id;	
		if(!empty($_GPC['keyWord'])){
			$keyWord = $_GPC['keyWord'];
			$_WHERE = ' title like "%'.$keyWord.'%"';
			$_WHERE_ARR[':keyWord'] = "%{$_GPC['keyWord']}%";

		}

		$formresult = pdo_fetchall("SELECT * FROM ".tablename("yts_qiye_category").$_WHERE ." order by add_time DESC ".$_limit);//查询所有活动
		


		
		$form_total = pdo_fetchcolumn("SELECT COUNT(*) FROM ".tablename('yts_qiye_category').$_WHERE);
		$_pagination_var = pagination($form_total,$_currentPage,$_pageisze);

		include $this->template('categoryList');
	}

		// 分类
	public function doWebCategoryEdit(){
		global $_W, $_GPC;
		$Id = $_GPC['id'];
		if ($_W['ispost']) {
			$title = trim($_GPC['title']);
			$sort = intval($_GPC['sort']);
			$type = intval($_GPC['type']);
		
			$arr = array(
				'title'=>$title,
				'type'=>$type,
				'sort'=>$sort,
				'setting_id'=> intval($_GPC['setting_id'])
			);
			if($_GPC['op'] == 'edit'){
				$result = pdo_update('yts_qiye_category',$arr,array('id' => $Id));
			}
			if(!$Id){
				$arr['add_time'] = time();
				$arr['setting_id'] = $this->setting_id;
				$result = pdo_insert('yts_qiye_category', $arr);
			}
			if (!empty($result)) {
				message('保存成功');
			}
		}
		if($Id ){
			$category_info = pdo_get('yts_qiye_category', array('id' => $Id));
		}
		include $this->template('categoryEdit');
	}

	//文章删除
	public function doWebCategoryDel() {
		global $_W, $_GPC;
		$id = intval($_GPC['id']);
		$exist = pdo_get('yts_qiye_category', array('id' => $id));
		if ($exist) {
			pdo_delete('yts_qiye_category', array('id' => $id));
				// site_cover_delete($id);
			message('删除内容成功', referer(), 'success');
		} else {
			message('内容不存在或已经删除！', referer(), 'error');
		}
	}


	public function  doWebBanner(){
		global $_W, $_GPC;

		$get_list = pdo_getall('yts_qiye_banner');

		$_pageisze = 20;
		$_currentPage = max((int)$_GPC['page'],1);
		$_limit = ' LIMIT '.($_currentPage - 1)*$_pageisze.', '.$_pageisze;
		$_WHERE ='';
		$_WHERES = array();

		// if(checksubmit()){

		// }
		if($_GPC['type_position']){
			$type_position= $_GPC['type_position'];
			$_WHERES['type_p'] = ' type_position = "'.$type_position.'"';
			

		}

		if($_GPC['type_skip']){
			$type_skip= $_GPC['type_skip'];
			$_WHERES['type_s'] = 'type_skip = "'.$type_skip.'"';
		
		}

		$seach = implode(' and ',$_WHERES);

		
		
		if(count($_WHERES) > 0){
			$_WHERE = ' WHERE '.$seach.' ';
		}

		$formresult = pdo_fetchall("SELECT * FROM ".tablename("yts_qiye_banner").$_WHERE ." order by add_time DESC ".$_limit);//查询所有活动
		foreach ($formresult as $key => $value) {

		
			$formresult[$key]['img_path'] = $this->attach($value['img_path']);
			$user = pdo_get('users', array('uid' => $value['uid']), array('username', 'uid'));
			$formresult[$key]['user'] = $user;
		}
		
		$form_total = pdo_fetchcolumn("SELECT COUNT(*) FROM ".tablename('yts_qiye_banner').$_WHERE);

	
		$_pagination_var = pagination($form_total,$_currentPage,$_pageisze);

		// var_dump($formresult);
		include $this->template('bannerList');
	}

	public function doWebBannerEdit(){
		global $_W, $_GPC;
		$Id = $_GPC['id'];
		if ($_W['ispost']) {
			$title = trim($_GPC['title']);
			$url = trim($_GPC['url']);
			$img_path = trim($_GPC['img_path']);
			$user_id = $_W['user']['uid'];
			$arr = array(
				'title'=>$title,
				'url'=>$url,
				'img_path'=>$img_path,
				'type_position'=> intval($_GPC['type_position']),
				'type_skip'=> intval($_GPC['type_skip']),
				'setting_id'=> intval($_GPC['setting_id'])
			);
			if($_GPC['op'] == 'edit'){
				$result = pdo_update('yts_qiye_banner',$arr,array('id' => $Id));
			}
			if(!$Id){
				$arr['add_time'] = time();
				$arr['uid'] = $user_id;
				$result = pdo_insert('yts_qiye_banner', $arr);
			}
			if (!empty($result)) {
				message('保存成功');
			}
		}


		if($Id ){
			$banner_info = pdo_get('yts_qiye_banner', array('id' => $Id));
		}
		include $this->template('bannerEdit');


	
	
	
	
	}


	//文章删除
	public function doWebBannerDel() {
		global $_W, $_GPC;
		$id = intval($_GPC['id']);
		$exist = pdo_get('yts_qiye_banner', array('id' => $id));
		if ($exist) {
			pdo_delete('yts_qiye_banner', array('id' => $id));
				// site_cover_delete($id);
			message('删除内容成功', referer(), 'success');
		} else {
			message('内容不存在或已经删除！', referer(), 'error');
		}
	}

	public function  doWebProduct(){
		global $_W, $_GPC;
		$_pageisze = 20;
		$_currentPage = max((int)$_GPC['page'],1);
		$_limit = ' LIMIT '.($_currentPage - 1)*$_pageisze.', '.$_pageisze;
		$_WHERE ='';
		$_WHERES = array();
		if(!empty($_GPC['title'])){
			$keyWord = $_GPC['title'];
			$_WHERES['title'] = ' title like "%'.$keyWord.'%"';
			$_WHERE_ARR[':title'] = "%{$_GPC['title']}%";

		}

		if(!empty($_GPC['category_id'])){
			$category_id = $_GPC['category_id'];
			$_WHERES['category_id'] = '  category_id = "'.$category_id.'"';
			$_WHERE_ARR[':category_id'] = "%{$_GPC['category_id']}%";

		}
		
		if(count($_WHERES) > 0){

			$seach = implode('and',$_WHERES);
			
			$_WHERE = ' WHERE '. $seach;
		}




		$formresult = pdo_fetchall("SELECT * FROM ".tablename("yts_qiye_product"). $_WHERE ." order by add_time DESC ".$_limit);//查询所有活动
		

		foreach ($formresult as $key => $value) {
			$category_id_info = pdo_get('yts_qiye_category', array('id' => $value['category_id']));
			$formresult[$key]['category_name'] = $category_id_info['title'];
			$formresult[$key]['img_path'] = $this->attach($value['img_path']);
			$user = pdo_get('users', array('uid' => $value['uid']), array('username', 'uid'));
			$formresult[$key]['user'] = $user;
		}

		$form_total = pdo_fetchcolumn("SELECT COUNT(*) FROM ".tablename('yts_qiye_product').$_WHERE);
		
		$_pagination_var = pagination($form_total,$_currentPage,$_pageisze);
		

		$category_info = pdo_getall('yts_qiye_category',array('type'=>2));
		
		
		include $this->template('productList');


	}

	public function doWebProductEdit() {
		global $_W, $_GPC;
	
		$Id = $_GPC['id'];
		
		if ($_W['ispost']) {
			$title = trim($_GPC['title']);
			$category_id = intval($_GPC['category_id']);
			$message = trim($_GPC['message']);
			$img_path = trim($_GPC['img_path']);
			$user_id = $_W['user']['uid'];
			if(strlen($title) AND strlen($message) ){

				$arr = array(
					'title'=>$title,
					'message'=>$message,
					'img_path' =>$img_path,
					'type_content' => 1,
					'category_id' => $category_id,
					'keywords' => trim($_GPC['keywords']),
					'ftitle' => trim($_GPC['ftitle'])
				);

				if($_GPC['op'] == 'edit'){
					$result = pdo_update('yts_qiye_product',$arr,array('id' => $Id));
				}

				if(!$Id){
					$arr['add_time'] = time();
					$arr['uid'] = $user_id;
					$result = pdo_insert('yts_qiye_product', $arr);
				}
				// type_content
				if (!empty($result)) {
				    message('保存成功');
				}
				
				
			}
			

		}



		if($Id ){
			$article_id_info = pdo_get('yts_qiye_product', array('id' => $Id));

		}
		$category_type_info = pdo_getall('yts_qiye_category', array('type' => 2));
		
	
		
		include $this->template('ProductEdit');
	}

		//文章删除
	public function doWebProductDel() {
			global $_W, $_GPC;
			$id = intval($_GPC['id']);
			$exist = pdo_get('yts_qiye_product', array('id' => $id));
			if ($exist) {
				pdo_delete('yts_qiye_product', array('id' => $id));
				// site_cover_delete($id);
				message('删除内容成功', referer(), 'success');
			} else {
				message('内容不存在或已经删除！', referer(), 'error');
			}
	}

		

	public function  doWebArticle(){

		global $_W, $_GPC;
		$_pageisze = 20;
		$_currentPage = max((int)$_GPC['page'],1);
		$_limit = ' LIMIT '.($_currentPage - 1)*$_pageisze.', '.$_pageisze;
		$_WHERE ='';
		$_WHERES = array();
		if(!empty($_GPC['title'])){
			$keyWord = $_GPC['title'];
			$_WHERES['title'] = ' title like "%'.$keyWord.'%"';
			$_WHERE_ARR[':title'] = "%{$_GPC['title']}%";

		}

		if(!empty($_GPC['category_id'])){
			$category_id = $_GPC['category_id'];
			$_WHERES['category_id'] = '  category_id = "'.$category_id.'"';
			$_WHERE_ARR[':category_id'] = "%{$_GPC['category_id']}%";

		}
		
		if(count($_WHERES) > 0){

			$seach = implode('and',$_WHERES);
			
			$_WHERE = ' WHERE '. $seach;
		}


		$formresult = pdo_fetchall("SELECT * FROM ".tablename("yts_qiye_article").$_WHERE ." order by add_time DESC ".$_limit);//查询所有活动
		
		foreach ($formresult as $key => $value) {
			$category_id_info = pdo_get('yts_qiye_category', array('id' => $value['category_id']));
			$formresult[$key]['category_name'] = $category_id_info['title'];
			$formresult[$key]['img_path'] = $this->attach($value['img_path']);
			$user = pdo_get('users', array('uid' => $value['uid']), array('username', 'uid'));
			$formresult[$key]['user'] = $user;
		}

		$form_total = pdo_fetchcolumn("SELECT COUNT(*) FROM ".tablename('yts_qiye_article').$_WHERE);
		
		$_pagination_var = pagination($form_total,$_currentPage,$_pageisze);

		$category_info = pdo_getall('yts_qiye_category',array('type'=>1));
		include $this->template('articleList');

	}

	//文章发布 编辑
	public function doWebArticleEdit() {
		global $_W, $_GPC;
	
		$Id = $_GPC['id'];
		
		if ($_W['ispost']) {
			$title = trim($_GPC['title']);
			$message = trim($_GPC['message']);
			$category_id = intval($_GPC['category_id']);
			$img_path = trim($_GPC['img_path']);
			$user_id = $_W['user']['uid'];
			if(strlen($title) AND strlen($message) ){

				$arr = array(
					'title'=>$title,
					'message'=>$message,
					'img_path' =>$img_path,
					'type_content' => 1,
					'category_id' => $category_id,
					'keywords' => trim($_GPC['keywords']),
					'ftitle' => trim($_GPC['ftitle'])
				);

				if($_GPC['op'] == 'edit'){
					$result = pdo_update('yts_qiye_article',$arr,array('id' => $Id));
				}

				if(!$Id){
					$arr['add_time'] = time();
					$arr['uid'] = $user_id;
					$result = pdo_insert('yts_qiye_article', $arr);
				}
				// type_content
				if (!empty($result)) {
				    message('保存成功');
				}
				
				
			}
			

		}

		if($Id ){
			$article_id_info = pdo_get('yts_qiye_article', array('id' => $Id));
		}
		$category_type_info = pdo_getall('yts_qiye_category', array('type' => 1));
		
		include $this->template('articleEdit');
	}

	//文章删除
	public function doWebArticleDel() {
		global $_W, $_GPC;
		$id = intval($_GPC['id']);
		$exist = pdo_get('yts_qiye_article', array('id' => $id));
		if ($exist) {
			pdo_delete('yts_qiye_article', array('id' => $id));
			// site_cover_delete($id);
			message('删除内容成功', referer(), 'success');
		} else {
			message('内容不存在或已经删除！', referer(), 'error');
		}
	}


	public function doWebContact(){
		global $_W, $_GPC;

		$Id = $_GPC['id'];
		$setting_id = $this->setting_id;
		if(!$setting_id){
			$setting_id = 1;
			$Id = 1;
		}

		if ($_W['ispost']) {

				$arr = array(
					'name'=>trim($_GPC['name']),
					'logo'=> trim($_GPC['logo']),
					'banner' => trim($_GPC['banner']),
					'message' =>  trim($_GPC['message']),
					'phone' =>  trim($_GPC['phone']),
					'address' =>  trim($_GPC['address']),
					'qq' =>  intval($_GPC['qq']),
					'email' =>  trim($_GPC['email']),
					'pictures' => trim($_GPC['pictures']),
					'setting_id' => intval($_GPC['setting_id']),
				);

				if($_GPC['op'] == 'edit'){
					$result = pdo_update('yts_qiye_contact',$arr,array('setting_id' => $setting_id));
				}

				if(!$Id){
					$arr['add_time'] = time();
					
					$result = pdo_insert('yts_qiye_contact', $arr);
				}
				// type_content
				if (!empty($result)) {
				    message('保存成功');
				}
				
		}

		$contact_info = pdo_get('yts_qiye_contact', array('setting_id' =>$setting_id));
		include $this->template('contact');
	}

	public function  doWebTemplate(){

	}
	public function  doWebNav(){
		global $_W, $_GPC;
		$_pageisze = 20;
		$setting_id = $this->setting_id;
		$table_name = "yts_qiye_nav";
		$_currentPage = max((int)$_GPC['page'],1);
		$_limit = ' LIMIT '.($_currentPage - 1)*$_pageisze.', '.$_pageisze;
		$_WHERE ='where setting_id = '.$setting_id;
		if(!empty($_GPC['keyWord'])){
			$keyWord = $_GPC['keyWord'];
			$_WHERE = ' WHERE title like "%'.$keyWord.'%"';
			$_WHERE_ARR[':keyWord'] = "%{$_GPC['keyWord']}%";

		}

		$info = pdo_fetchall("SELECT * FROM ".tablename($table_name).$_WHERE ." order by add_time ASC ".$_limit);//查询所有活动
		
		foreach ($info as $key => $value) {
			// var_dump($value['img']);
			$info[$key]['img'] = $this->attach($value['img']);
			$info[$key]['selimg'] = $this->attach($value['selimg']);
		}


		$form_total = pdo_fetchcolumn("SELECT COUNT(*) FROM ".tablename($table_name).$_WHERE);
		
		$_pagination_var = pagination($form_total,$_currentPage,$_pageisze);


		include $this->template('nav');
	}

	public function  doWebNavEdit(){
		global $_W, $_GPC;
		$table_name = "yts_qiye_nav";
		$setting_id = $this->setting_id;
		$Id = $_GPC['id'];
		if ($_W['ispost']) {
		
			$arr = array(
					'name'=>trim($_GPC['name']),
					'sort'=>intval($_GPC['sort']),
					'phone' =>trim($_GPC['phone']),
					'url' => trim($_GPC['url']),
					'type' =>intval($_GPC['type']),
					'img' => trim($_GPC['img']),
					'selimg' => trim($_GPC['selimg']),
				);

				if($_GPC['op'] == 'edit'){
					$result = pdo_update($table_name,$arr,array('id' => $Id));
				}

				if(!$Id){
					$arr['add_time'] = time();
					$arr['setting_id'] = $this->setting_id;
					$result = pdo_insert($table_name, $arr);
				}
			// 	// type_content
				if (!empty($result)) {
					// message('保存成功');
					message('保存成功',url('site/entry/Nav', array('m' => 'yts_qiye','setting_id'=>$setting_id)));
				}
				
		}

		$info = pdo_get($table_name,array('id'=> $Id));

		include $this->template('navEdit');
	}
	//导航删除
	public function doWebNavDel() {
		global $_W, $_GPC;
		$table_name = "yts_qiye_nav";
		$id = intval($_GPC['id']);
		$exist = pdo_get($table_name, array('id' => $id));
		if ($exist) {
			pdo_delete($table_name, array('id' => $id));
			
			message('删除内容成功', referer(), 'success');
		} else {
			message('内容不存在或已经删除！', referer(), 'error');
		}
	}


	public function  doWebOther(){
		global $_W, $_GPC;
		$table_name = 'yts_qiye_setting';
		$setting_id = $_GPC['setting_id'];
		if(!$setting_id){
			$setting_id = 1;
			
		}
		if ($_W['ispost']) {
			$arr = array(
				'title' => trim($_GPC['title']),
				'sitename' => trim($_GPC['sitename']),
				'template' => intval($_GPC['template']),
				'head_color'=> trim($_GPC['head_color']),
				'font_color' => trim($_GPC['font_color']),
				'nav_background_color' => trim($_GPC['nav_background_color']),
				'nav_font_color'=> trim($_GPC['nav_font_color']),
				'nav_sfont_color' => trim($_GPC['nav_sfont_color'])
			);
			// if()
			// contact_name
			if(!$setting_info = pdo_get($table_name,array('id'=>$setting_id))){
				$arr['add_time'] = time();
				$user_id = $_W['user']['uid'];
				$arr['uid'] = $user_id;
				
				$result = pdo_insert($table_name, $arr);
				
			}else{
				$result = pdo_update($table_name,$arr,array('id' => $setting_id));
			}
			
			if (!empty($result)) {
				message('保存成功');
			}
		
		}



		if($setting_id){
			$info = pdo_get($table_name,array('id'=>$setting_id));
		}else{
			$info = array();
		}


		include $this->template('other');
	}
	public function  doWebSeo(){
		global $_W, $_GPC;
		$table_name = 'yts_qiye_seo';
		$setting_id = $this->setting_id;
		if ($_W['ispost']) {
			$arr = array(
				'seo_title' => trim($_GPC['seo_title']),
				'seo_keywords' => trim($_GPC['seo_keywords']),
				'seo_articleTitle' => trim($_GPC['seo_articleTitle']),
				'seo_description' => trim($_GPC['seo_description']),
				'seo_img' => trim($_GPC['seo_img']),
			);
			if($_GPC['type']){
				
				
				if($_GPC['type'] == 'index'){
					$arr['type'] =  'index';
				}elseif($_GPC['type'] == 'news'){
					$arr['type'] =  'news';
				}elseif($_GPC['type'] == 'product'){
					$arr['type'] =  'product';
				}elseif($_GPC['type'] == 'obut'){
					$arr['type'] =  'obut';
				}elseif($_GPC['type'] == 'product_details'){
					$arr['type'] =  'product_details';
				}elseif($_GPC['type'] == 'news_details'){
					$arr['type'] =  'news_details';
				}

				if(!$arr['type']){
					message('非法数据');
					return false;
				}
				if($seo_info = pdo_get($table_name,array('type'=>$arr['type'],'setting_id'=>$setting_id))){
					$result = pdo_update($table_name,$arr,array('id' => $seo_info['id']));
				}else{
					
					$arr['add_time'] = time();
					$arr['setting_id'] = $setting_id;
					$result = pdo_insert($table_name, $arr);
				}
	
				if (!empty($result)) {
					message('保存成功');
					
				}
			}

		}
		if(!$_GPC['type']){
			$_GPC['type'] = 'index';

		}

		$seo_info = pdo_get($table_name,array('setting_id'=>$setting_id,'type'=>$_GPC['type']));
	
		if( ($_GPC['type'] == 'news') OR ($_GPC['type'] == 'product')){
			$seo_details_info = pdo_get($table_name,array('setting_id'=>$setting_id,'type'=>$_GPC['type'].'_details'));
		}
		


		include $this->template('seo');
	}
	public function  doWebInterface(){
		global $_W, $_GPC;
		$table_name = 'yts_qiye_interface';
		$setting_id = $this->setting_id;
		if ($_W['ispost']) {
			$arr = array(
				'status'=>intval($_GPC['status']),
				'type' => intval($_GPC['type']),
				'banner_api'=>trim($_GPC['banner_api']),
				'banner_list_api' =>trim($_GPC['banner_list_api']),
				'news_api' => trim($_GPC['news_api']),
				'news_index_api' => trim($_GPC['news_index_api']),
				'news_details_api' =>trim($_GPC['news_details_api']),
				'product_api' => trim($_GPC['product_api']),
				'product_index_api' => trim($_GPC['product_index_api']),
				'product_details_api' => trim($_GPC['product_details_api']),
				'site' => trim($_GPC['site'])
			);


				if($seo_info = pdo_get($table_name,array('setting_id'=>$this->setting_id))){

					$result = pdo_update($table_name,$arr,array('setting_id' => $this->setting_id));
				}else{
					
					$arr['add_time'] = time();
					$arr['setting_id'] = $this->setting_id;
					$result = pdo_insert($table_name, $arr);
				}
				
		

			if (!empty($result)) {
				message('保存成功');
				
			}
			


		}


		$info = pdo_get($table_name,array('setting_id'=>$this->setting_id));


		include $this->template('interface');
	}





	public function doWebSetting() {
		global $_W, $_GPC;
		$_pageisze = 20;
		$table_name = "yts_qiye_setting";


		if ($_W['ispost']) {
			if($_GPC['op'] == "news"){
				$arr = array(
					'title'=>trim($_GPC['title']),
					'sitename'=> trim($_GPC['sitename']),
					'template' => 1,
					'font_color' => '#ffffff',
					'head_color' => '#ff0000',
					'add_time' => time()

				);
				$user_id = $_W['user']['uid'];
				$arr['uid'] = $user_id;
				$result = pdo_insert($table_name, $arr);

			}

			if (!empty($result)) {
				message('保存成功', referer(), 'success');
			
			}


		}



		$_currentPage = max((int)$_GPC['page'],1);
		$_limit = ' LIMIT '.($_currentPage - 1)*$_pageisze.', '.$_pageisze;
		$total = pdo_getcolumn($table_name, array(), 'count(*)');
		$manage_info = pdo_fetchall("SELECT * FROM ".tablename($table_name).$_WHERE ." order by add_time ASC ".$_limit);//查询所有活动
		$_pagination_var = pagination($total,$_currentPage,$_pageisze);
		


		include $this->template('setting');
	}


	public function doWebSettingDel() {
		global $_W, $_GPC;
		$id = intval($_GPC['id']);
		$table_name = "yts_qiye_setting";
		$exist = pdo_get($table_name, array('id' => $id));
		if ($exist) {
			pdo_delete($table_name, array('id' => $id));
			//删除导航菜单表
			pdo_delete("yts_qiye_nav", array('setting_id' => $id));
			pdo_delete("yts_qiye_contact", array('setting_id' => $id));
			pdo_delete("yts_qiye_seo", array('setting_id' => $id));
			pdo_delete("yts_qiye_interface", array('setting_id' => $id));
			// site_cover_delete($id);
			message('删除微页面成功', referer(), 'success');
		} else {
			message('微页面不存在或已经删除！', referer(), 'error');
		}
	}



	public function doWebDelMsg() {
		pdo_run('TRUNCATE ' . tablename('yt_baiduapp_message'));
		itoast('', $this->createWebUrl('manage'));
	}
	

	// public function doWebDel() {
	// 	global $_W, $_GPC;
	// 	$id = intval($_GPC['id']);
	// 	$exist = pdo_get('site_page', array('id' => $id, 'uniacid' => $_W['uniacid'], 'type' => 1));
	// 	if ($exist) {
	// 		pdo_delete('site_page', array('id' => $id, 'uniacid' => $_W['uniacid'], 'type' => 1));
	// 		site_cover_delete($id);
	// 		message('删除微页面成功', referer(), 'success');
	// 	} else {
	// 		message('微页面不存在或已经删除！', referer(), 'error');
	// 	}
	// }

}